home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-12 | 1.0 KB | 25 lines | [TEXT/ToyS] |
- -- Currency Converter.rsrc
- property exchangeRate : 1.68
- set dlog128 to {size:[320, 170], name:"Currency Converter", style:standard window, contents:[¬
- {class:push button, bounds:[240, 140, 310, 160], name:"Convert", action:"convert"}, ¬
- {class:text field, bounds:[220, 30, 295, 46], value:exchangeRate}, ¬
- {class:text field, bounds:[220, 59, 295, 75], value:100}, ¬
- {class:text field, bounds:[220, 90, 295, 106], value:100 * exchangeRate}, ¬
- {class:static text, bounds:[30, 30, 205, 46], contents:"Exchange rate per £1:"}, ¬
- {class:static text, bounds:[30, 60, 205, 76], contents:"Pounds to convert:"}, ¬
- {class:static text, bounds:[30, 90, 205, 106], contents:"Amount in other currency:"} ¬
- ], closeable:true ¬
- }
-
- dd auto dialog dlog128 with grayscale given script:me
-
- on Convert()
- try
- set [a, b] to dd get value of items 2 thru 3 of dialog 1
- dd set value of item 4 of dialog 1 to (a as number) * (b as number)
- set exchangeRate to a
- on error
- dd set value of item 4 of dialog 1 to "?"
- beep 2
- end try
- end Convert